package com.uzhie.jt808.jt1078.entity;

import com.uzhie.jt808.JT808MsgBody;
import com.uzhie.jt808.msg.entity.MyBuffer;
import org.apache.log4j.Logger;

/**
 * 用户客流上传，在视频分析界面查看
 */
public class JT_1005 implements JT808MsgBody {

    String startTime;
    String endTime;
    short upCount;
    short downCount;

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public short getUpCount() {
        return upCount;
    }

    public void setUpCount(short upCount) {
        this.upCount = upCount;
    }

    public short getDownCount() {
        return downCount;
    }

    public void setDownCount(short downCount) {
        this.downCount = downCount;
    }

    private static Logger logger = Logger.getLogger(JT_1205.class);


    @Override
    public byte[] WriteToBytes() {
        MyBuffer buffer = new MyBuffer();
        buffer.put(getStartTime());
        buffer.put(getEndTime());
        buffer.put(getUpCount());
        buffer.put(getDownCount());
        return buffer.array();
    }

    @Override
    public void ReadFromBytes(byte[] body) {
        MyBuffer buffer = new MyBuffer(body);
        setStartTime(buffer.getString(6));
        setEndTime(buffer.getString(6));
        setUpCount(buffer.getShort());
        setDownCount(buffer.getShort());
    }
}
